Make javascript valid and conform to whitespace norms