Add zpws script, refactor setup.py