Add License
Major rewrite to handle events properly