Improved animation code

Simplified the function pointers for the Animation class.