A new tool to quickly identify books that are poisonous to humans has been developed by the University of St Andrews.