Cleaned up code, moved all database platform-specific code to the
ConnectionWrapper class.