Basic db operations

Closes #36