Few bugfixes

* Ensure action[map] is actually defined to something before checking
for bound events.
* fire on events rather than before events twice
* correct reference to bound method inside xhr onreadystatechance