first version of database stuff
Tests working for database
Added method headers and cleaned stuff up