Use UMD pattern for compatibility with different module formats
Update docs
Merge pull request #4 from simonsmith/umd

Use UMD pattern for compatibility with different module formats