heaps of updates. 
* the restlet unit tests now work
* add extra unit tests
* refactor code to be cleaner