Remove newlines and tabs from JS output

and accidentally trim a bunch of trailing space.