Add some basic tests.

Also add a plugin for running an embedded MongoDB instance, and
use a dummy Application which uses this in tests.