Browserify was the major culprit for our slow load times, so I must integrate it in as part of the build rather than letting it run on page load. I also removed the request module as it gave little and added about 50 ms to the load times. I could shave off more time by downloading leaflets images and hosting them myself. Finally, I need to set the api URL based on a build-time environment variable so that developers can test locally and clients connecting to nodejitsu can hit the public-facing url.
Just some minor improvements to the code (naming and commenting).
Run the grunt command to browserify to /public/javascripts/bundle.js. This is necessary to keep our load times down.
I think I'm smart in a way that I was dumb. Relative paths work in client javascript...
I no longer need bundle.js as part of the source tree now that grunt is building it for me.
Now that grunt is building bundle.js, git can ignore it.