Wrap js files in functions, so we can quit early