Checkin-in commit. Adding events and events collection. Lots more refactoring. Commented out the events/hooks for now until it is completely refactored.