Modified Books class to query from a view instead of a table to allow
the output of average ratings for each book as well. Added new
Database.error() functions for convenience.