wrap the js in a closure for better encapsulation

I also added
"use strict" just in case our devs
don't know code standards.