Cleaning up Calendar.renderState()
Application.navigateState(), Application.getState()

navigateState() retrieves app state via getState(), then loads that via
FlxState.router.
DateUtils

for moving this stuff out of Calendar
Use data option to $.ajax() instead of query string construction

jQuery will take care of the mechanics of building GET param strings for
us :)
s/DAY/date/g,s/WEEK/week/g,s/MONTH/month/g,s/YEAR/year/g

Increase sanity by making the internal timeUnits match their URL
representation. Still need to make CalendarController do this as well.
Switch to GET requests for all CalendarController methods

AFAICT these methods don't do any writes, and they also use GET params,
so why not just make them GET requests?
Moving Builder.bindTimeUnitsMenu() call into Builder

This function references Calendar for its state, so there's no reason to
rebind it on each click.
Removing verb param from fetchState()

Now that all requests are GET requests, we don't need this. Also removed
timeNavBtn(), which grep -R shows is dead code.
More refactoring

- Moved addCommas() to StringUtils.
- Changed updateDatepicker() to use split() for grabbing URL/state
  parts.
Fixing earlier bug with today button

Forcing a Builder.createTabs() after setting Calendar.timeUnit works
here.
Issue one require() call for loading all applications

This uses map, arguments to load all applications in one require() call.
Also removed appLoaded() callback, since we can just do the
menu/Backbone/render initialization at the end of the app-loading loop.
App now directs Calendar/App to render via URL

- Moved Application.render() to App.render().
- Added setupURLRouting(), which sets up a global URL handler that
  delegates to the appropriate app for handling. It also sets up a
  default URL handler for loading, e.g., /app.
- Introduced Application.parseState(), which packages the URL state for
  an app into a state object. This object is passed on to
  Application.renderState().
- Add a couple more utility methods on String.prototype.
Switching rest of fetchState calls to use params
More concise bindTimeUnitsMenu() implementation
Call fetchState() from bindTimeUnitsMenu() onclick handlers

The eventual flow will look like this:

- When you click a button, it fetches the next state via fetchState();
- The fetchState() callback calls FlxState.router.navigate();
- The routes set up in App.setupURLRouting() are triggered, resulting in
  a call to renderState();
- renderState() takes care of fetching Calendar data, re-rendering tabs,
  storing old tab state, etc.

This is an incremental step towards the first part, in which
fetchState() becomes the common entry point to this state updating flow.
Cleaning up TabInterface loading, onclick handler
Calendar TabInterface onclick listener now uses navigateState()

instead of calling render(), so that the URL handler calls render().
Unifying fetchState() callbacks from Calendar, Builder

Merged the bindTimeUnitsMenu() and default fetchState() callback into
one function. renderState() no longer calls fetchState(). One step
closer.
Moving time nav button setup into Builder
Moving fetchState() before parseState()

so that these are in logical order.