Add heaps of JS- and whitespace-related fixes