Rewrite to properly handle pulls/pushes using client-side metafiles and server-side locking