Added Namespacing. Merge from platform commits (1739 & 1591)

Added Namespacing. Merged platform commits (1739 & 1591)

https://github.com/joomla/joomla-platform/issues/1739
https://github.com/joomla/joomla-platform/issues/1591