Made updating of occurrences in offline cache happen only when there is really a change.

Signed-off-by: Michel Verbraak <info@1st-setup.nl>
Fixed warning about writing a too large value to the syncState preference.
The syncState is now saved to a syncState.txt file below the TB profile/exchange-data folder

Signed-off-by: Michel Verbraak <info@1st-setup.nl>