Wrap whole lib in IIFE to circumvent problems with eval-based devtools

This pull-request replaces #270

@matthew-andrews you're probably right about the UMD wrapper. I just thought I'd use UMD as a sane default. This pull-request now just wraps the whole lib with an IIFE without changing the export mechanisms.