Merge pull request #4 from greeny/master

Merged all remaining changes and released 3.1.0