Database functionalit and error handling

Added all database functionality that is needed for now.  Also added
some error handling. The only thing that is left until we can take this
baby out for a spin is to add more houses to the database and a few more
comments to the code.