Overhauled error handling in Database classes

Since we're no longer using prepared statement emulation, prepares fail at another stage which did not properly report the actual error message.

Additionally I've changed the error mode to actually throw exceptions rather than bogus non-success return values like 'false'.