Major rewrite

Built event/listener system.
Modified command system to be cleaner.
Other minor changes.