Unify serial and parallel dofmap construction, fix issue with global dofs.