Added changes to Database interface. This is not completely finalized
(we still need to nail down the query API in addition to module
metadata).