Fixed bugs in request code
Cleaned up agitate.py
Updated unit tests and fixed some bugs in agitate.py