Minor reorganization of client-side js.
further controller middleware cleanup