MODx:beforeLoadPage javascript event

Less changes = less head ache.
I replaced almost all direct location changes by MODx.loadPage proxy to allow to handle page loading. This is used by http://modx.com/extras/package/ajaxmanager
My last three patches add ability of ajax page reloading (via plugin) to MODx Manager.

Later, we can build ajax page switching in MODx itself.