clean up code
move js into scope and enable strict mode