Finished database mapping

Closes #2