Basic database code added and tested.
Changes merged.