Ensure namespaces and vars are ordered by writer