Make node.js runtime properly handle legacy docs.
Rewriting added to handle legacy docs which have exported object names the same as constructors