Started implementation of database class. Wrote some basic functions and API.