Rewrote the animations handler.

Still some progress to be done.  Generally just trying to optimize now.