Refactor parallel dof ordering.