API: support for callbacks on entry switch for collections

Added addToCollectionWithCallbacks which behaves like addToCollection except it accepts two callbacks.
Those callbacks are invoked when switching views in a collection.

This change is backwards compatible.
Change Entry type to a record because it's getting unwieldy.
Merge pull request #51 from fredlebel/master

Added callbacks when entries in a collection are switched to/from.