Python 3 compat: Improve subprocess, WSGI and tests