jshint cleanup, change indentation to 2 spaces
Wrap code in self-executing anonymous function

This helps us avoid scoping conflicts and also makes it easier to
extend if we add more modules.