Merge pull request #1 from davidmoten/master

Update with DaveMoten last commits
Commit of latest tests
Merge pull request #4 from maxamel/master

Add unit tests.
Thanks Max