Prevents pollution of global namespace in SP.

Adds anonymous function wrapper around core SP code, preventing global
namespace pollution.
Merge pull request #8 from rhyolight/js-scope-cleanup

Prevents pollution of global namespace in SP.