Fix: consider base classes while determining table names

Example use case: Standard mixin which defines the table names

```python
class StandardMixin(object):
  @declared_attr
  def __tablename__(cls):
    return cls.__name__.lower()
```