Fixed two issues

- DelegatedEventHandler no longer tries to check events on the window element
- Fixed jshint error in test
Allowing delegation of arbitrary events

- Now creates handlers on the fly, as needed
- Fixed bug preventing proximity handlers from working
- Minor code cleanup
Adding initial functional test