Update namespace.js

- Changed the variable name
- Added window.parent support
- Removed child object instead only inject namespace if the node is an object