Move generateCssKeyframes code to generateAnimationCss

The purpose of these 2 functions is the same, so no decomplection via
splitting them apart.

Also, comments.
Fix whitespace (tab vs space)