add animation library

I refactored the anim8 library into `animation.lua`.