Use Werkzeug's EnvironBuilder.

...rather than our home-rolled function.