Always close the database connection.
Stream as JSON if the client asks for it.
Don't need bbox on all the queries.
Can't use after-request closing because it happens before stream is done.
Trying to add some debug info to figure out db connections.
Don't rollback the connection (which seems to imply closing).
Better debug?
Make port info permanent.
Try deleting the cursor?
Ok that didn't work...
Try opening a new connection every time?
Try to figure out where the closing osm tag went.
Hang on to the db connection as well as the cursor.
Keep the request context around to save the g object.
Log the request URL
Use lxml instead of minidom.
Deal with encoding problems that showed up after switching to lxml.
Coerce relation member ids to strings.
Update requirements to point to lxml
Handle all the freetext as unicode utf8.