Cleaned up state transitions so they can be copied for different states. Started working on adding generic hadeling of event callbacks for objects.