Refactoring

Eliminated some redundancies in the AJAX helper file; shifted some of
the setup to the main app module