Rewrite vendor/constants.js to use require("ast-types").traverse

Most notably, this new style of transformation gives us access to `this.parent.node`, which allows us to avoid replacing identifiers that are not actually free variables, such as member expression properties.

Closes #496.