Refactoring: added BaseModel class

This extends the Model class by specifying the database (avoids to
write it for every table class definition).