Major code cleanup

- genericise the proxy class. now an agent is
passed into the proxy class...
- plyflakes remote superfluous imports