Various style refinements. No change in behavior intended.
Remove require('http') since we're not using it.
Shuffle flattenPromises and update functions to use after declaration.

Previously we were using these before declaration.
Add an interface to wrap third-party middleware in an Angular context.

This will be useful for callers that want to build custom request
handlers that make use of AngularJS services from the same set of modules
we were instantiated with.
Add an initial simple test and jshint configuration.
Make the lifetime of jsonRetRoute and jsonRet clearer.

Although JavaScript doesn't have block-level scope, our intentions are
clearer here if we pretend it does.