Got namespace handling completely done in PHP. Removed JS patch.