Add documentation

* Add a user guide
* Add a sample implementation
* Tidy up some of the code slightly
Merge pull request #7 from uor/docs-and-sample

Add documentation