Improve namespace rendering

Removes the initialization of the leaf namespaces, since exposed values will be assigned to them. The algorithm was also simplified.

Closes #1