add jsdoc comments to pane.js, cleanup code and tests