Added database retrival functionality and tests related to this. Also
improved user input validation testing.