Support generating tablenames in more cases.

Extends naming rules to apply to base classes of models.  This supports joined table and single table inheritance, inheriting from mixins and abstract models, and *some* complex inheritance combinations.

Resolves the following issues:

* mitsuhiko/flask-sqlalchemy#83
* mitsuhiko/flask-sqlalchemy#198
* mitsuhiko/flask-sqlalchemy#204

I am almost 100% confident that this does not break existing behavior; however, the original behavior was not well documented or tested.  This does seem to cover all "normal" cases that I've run into, and I've added tests for these cases.  I did not test concrete table inheritance in its various forms as I am not familiar enough with it.