Refactored Database to use a getfromdatabase method, which uses an optional formatter. Also made formatters.