Had to pretty much re-implement how --ext-namespaces works in new parser context. However, the implementation is much simpler than the one for old parser.