Get data saving functionality and tests

Description:
Also, preliminary tests for retrieving data from the database. Some
functionality. I think the code works, but I'm having a heck of time
testing it.