added umd & use a prototype

The commit-note lists the changes.

Diff looks a bit scary because I put everything in a closure for UMD; and the indenting was a funky mix of 2 and 4 spaces... I went for 4 :wink:

If you append `?w=1` to the PR then the diff ignores whitespace and you see the prototype changes a bit better.