Added sync-write command, and a corresponding test.