Abstract MySQL and add postgresqlite support

See pull request 106 for more information.