Use singleton for db.Model

This change uses a singleton for db.Model, permitting sane subclass behavior.
That is, rather than

    ```python
    BaseModel = db.Model
    class Foo(BaseModel):
        def __init__(self, *args, **kwargs):
            super(BaseModel, self).__init__(*args, **kwargs)

        def extra(self):
            pass
    ```

one can simply write

    ```python
    class Foo(db.Model):
        def __init__(self, *args, **kwargs):
            super(db.Model, self).__init__(*args, **kwargs)

        def extra(self):
            pass
    ```

as you would expect.