only save synclog if necessary
maintain dict mapping of case state
pep8
use list to copy instead of list comprehension
simplify _phone_owns
Merge pull request #5086 from dimagi/synclog-tweaks

Synclog tweaks