Move javascript inside functions
Remove undefined param due to conflict with closure compiler
Merge master
Merge pull request #54 from ryanathasoffers/misc_cleanup

Move javascript inside functions