Wrapping JS in self-invoked anonymous function