ugrid2d: broge logic for local and remote buffers into separate classes (fixing a resize bug in the process)