Additional progress.

Includes:
* full test coverage for modules/results/*
* abstracts out DB interaction into its own module
* introduces notion of a ServiceException, for uniform raising of
exceptions by a module.  These include an HTTP status code, to be used
by the REST server.
* minor cleanup