Refactor to clean up server/app files

        - Make comments consistent throughout
        - Tighten up code
        - Make local functions explicit
        - Add tests
        - Remove uneeded functions
        - Move plan, work, and staff into module-wide object and pass into
          request objects
        - Tighten up use of filters
        - DRY up code with respect to lua_modules
        - Split router.lua into multiple files for each type of routing work