Update API doc, consolidate code and add JavaDoc where necessary
Merge pull request #4 from ridoo/master

Update API doc, consolidate code and add JavaDoc where necessary