Generalize library.

This generalizes the implementation of the library, freeing it from
being too tightly coupled to Express applications. It now works with
Express routers and libraries with similar APIs.
Merge pull request #1 from jmeas/use-router

Use a Router instead of an Application.