JSDoc updates, if statement cleanup
correcting some readme example code
Merge pull request #4 from tlhunter/doc-update

Doc update