Separated database interface and adapters

Added an sql adapter as an abstract base class for sql-based database
adapters. Moved the logic from database.rb over to the respective
adapters for sqlite3 and mysql.
The database.rb will now act as interface for the adapters and instance
one adapter deduced from the db_type in the config.

On completion of this separation, gem version 3.1 will be released.