Wrap script in immediately-invoked anonymous function.

Avoid jQuery error ($ does not exist).