Various javascript improvements.