Reorder imports on module_render
Rename arguments of modx_dispatch and handle_ajax related functions

Refactor a bit modx_dispatch