refactor dialect changes

There are two main things going on with this pull request:

* I changed the enums for dialect to a "database type" to more closely follow QSqlDriver's internal representation of database type. I'm submitting patches to Qt to make this public, after conversation with mabrand, so hopefully this will make that transition smoother in the future.

* Database type is now cached. This is a nominal improvement (latin-1 string compares vs enum compares) currently, but will show more efficiency when I submit my changes to detect database type when using the ODBC driver as that is somewhat more involved