Add page:before-unload event - Close #401
Add Prototype compatibility with custom events - Fix #384
Maintain load order of scripts in the body - Fix #389