Small code cleanup

Move a JavaScript routine that was not generic out of the generic
module.
Remove duplicate require instruction.