Move even more shared funtionality into table.py

If this goes on, I'll have a complete database abstraction layer soon.
Implement automatic table generation from attributes.

This doesn't implement default values yet. Also, no things like primary
key are supported, either.
Implement default values.