make sync feature keep state files in explicit (external) location rather than root of tree; update tests