Add logging of state changes.

You can enable or disable this by setting ludum.globals.logStateTransitions.