migrating to setup.py, improving protocol support