Clean up SQLAlchemy generation

Our SQLAlchemy lowering has some issues.  Here is a PR to start cleaning it up.