refactor js library defs, bug fixes, and tests
@bug W-2360275@
@bug W-2318010@
@bug W-2328644@
@rev goliver@
Merging origin/gtorres/master-pending-libs into master