Implemented fnc_doAnimation, some other stuff

Also fixed some oddities that might have caused some bugs here and there.

Needs testing before merging.