Added state change listeners and events.
Refactored.
Bumped up to version 0.0.2, added listeners and events to Main class.