Add first version of database functionality.