Add support for pausing the game timer

Moved the time-related functions from base.js into a separate time.js file and
added pause() and unpause() functions.

These affect the overall game time; the idea is that you could call pause() in
the enter() method for your paused state and unpause() in the leave() method.