Split out namespace management

Change-Id: I1e3484b6e3bb95b427aa0b738de718a8bac9268b