Rework form.js to use deferreds
Rework form.js to use deferreds

Mostly this is returning the jquery getJSON functions from where they are called so that we can use `$.when(...).then(...)` to do things once we know they have resolved.  This means we make sure to only call, for example, our pushstateHandler to update the URL when we know the peitition has loaded and been drawn.

The most complex rewrite is loadPetition because it runs a $.getJSON to fetch the petition data and when that is successful it runs reloadMap() which is in turn a deferred.  So we have to construct and return our own deferred object and resolve/reject it based on the resolve/reject state of both the $.getJSON and reloadMap calls.

We also take the opportunity to rename functions to use more JS style (camelCase instead of snake_case).

tlfrd/petition-map,tlfrd/petition-map,unboxed/petition-map,unboxed/petition-map