Add support for writing; run sync periodically