incremental commit: start functorising everything over an irmin View

It's hard to do this incrementally so most of the logic has been
commented-out.

Signed-off-by: David Scott <dave.scott@citrix.com>