Fixed pyflakes errors and other minor stuff.
Made the connection header Httpkom-Connection a constant instead of config.