Update history instead of appending to it (=bloating)
Store Kolab_Storage_Factory in class (we need it later on)
Compute proper history prefix for Kolab objects

The IDs in the history database are always
formatted like this: "APPNAME:SHARE_ID:OBJECT_UID".

Kolab must compute the same prefix for objects
synced in from foreign clients. Otherwise client code
using the listBy() or getChanges() API (=ActiveSync)
would miss those objects.
Only consider known 'action' values for finding the latest history entry
Re-issue 'add' action for an object if the last action was 'delete'

In the Kolab world, objects can vanish
and re-appear using the same object uid.
(a foreign client is sending an update over a slow link,
 we see the delete first and minutes later the APPEND/add request)
Only issue a 'delete' action if all copies of an object are gone

Otherwise we just deleted a duplicated object or updated the original one.
(An update results in an ADDED + DELETED folder action)
Improve IMAP folder UIDVALIDITY change detection. Fixes #11807.

We stored the whole list of IMAP UIDs of a folder next
to every object. This turned out to be a major memory
and CPU time hog (see #11807).

Instead we detect a change of UIDVALIDITY at the
IMAP folder cache level (where it belongs) and pass
the information about a reset situation to the
history 'query' as additional parameter.
Full sync for the history database: Mark vanished entries as deleted
Update history instead of appending to it
Tie Kolab_Storage to Horde_History if enabled

Otherwise Kolab_Storage_Factory::createHistory()
will use the in-memory only Horde_History_Mock object.
Fix Kolab <-> Horde_History sync marker: The 'sync' timestamp must be per folder

Otherwise one folder overwrites the sync marker of other folders.

We need to keep our own timestamp since the sync of a folder cache
might be successful but the history sync could fail (timeout etc).
Adapt Kolab Horde_History unit test to new id prefixes
New UT: Test stale history cleanup on full history sync
New UT: Ensure history does not get polluted for unknown folder types
New UT: Ensure no 'delete' action gets issued on duplicate removal
New UT: Test for 'modify' action on object uid re-appearance