Dbic support

... and added tests for the Database provider too.