Split JavaScript out into separate file