Simplified event binding/handling
Simplified some code
Don't poison the global scope