Initial commit of early database functions.