Refactor TimeManager to use FlxG.signals.

The TimeManager plugin is now based on the new plugin architecture. It uses signals to monitor state switches.

The signal "beforeStateSwitch" was added to FlxG.signals. It is dispatched when the current state is about to be destroyed and the new state is about to be assigned as the current state.