SQLite compatibility and related fixes
Separated SQL script into .mysql and .sqlite scripts for specific databases
Fixed SQLite incompatibilities (at the expense of MySQL which can be fixed by switching on ANSI mode or waiting for fix)
Fixed some foolish use of functionality inside Q_ASSERT which gets compiled away (tut tut james)
Had to remove INSERT INTO x SET .. statements, as SQLite doesn't like them
Made wrapper function for SQL queries that can print debug information and will eventually display a dialog box with an error if there is a problem, offering a chance to try and fix the database