Add Database monad

This simplifies working with the database as the monad is defined
in terms of Reader.