Isolate the WSGI wrapper into a helper module
Use iterators to set the entry tags