Update namespace.js

Heavily modified revision for previous feature req