New animation api

Moved animation framework from the map into a standalone `clock` class.