change internal design of animate.js and a bit of cleanup