Revert commit to fix build. The variables are undefined based on load order in browser. Needs an AMD like feature to avoid script load order dependencies.

Revert "Pull out variables for other scope to a more generic level"

This reverts commit 400b09c029f551ec2943e229dd1f40d7ab929d53.
Add missing semi-colon