Ported (most of) the namespace APIs.