JS cleanup
Merge + fix sharing bits.