Made everything event-driven, added example usage and TODO