Started structure of the database abstraction layer. It needs to still be improved quite much. Also added new options to config.