Update documentation, and cut down on duplicate js.