put more logic into prepare-merge function, which simplifies a lot of things
separate the functionality which adds new events from sync-file and
merge-remote
fill the updated list directly in sync-file

the updated list must include also unchanged events. or they will
appear to be new, later.
fix typo which prevented local deletion
remove leading whitespace
support repeater rules
tiny code improvement
only add if-modified-since header, if state is current
check whether timestamp changed before updating it