Added the animation directory and added scripting callbacks to the animation code