Database: rename MAP2 to MAP, Map2 to Make and extract a common signature

Names like "MAP2" beg the question, "what happened to MAP1?"

This patch also factorises the ROW, TABLE, TABLESET signatures into a
shared common portion, with specific extensions on top.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Database: replace the raw 'int64' with a 'Time.t' (= Generation.t)

This means that
- if you read the type, you realise this isn't just any old int64
- we are closer to making it fully abstract

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Database: every function which takes Time.t -> Time.t has the third Time.t

Some of the functions omitted the third Time.t (the deleted time), because
the object could not have been deleted yet. Elsewhere we have the convention
that a live object has deleted = 0L.

This patch makes all the Time.t -> Time.t (-> Time.t) functions consistent.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Database: every function which takes 3 Time.ts now takes Stat.t

The 3 Time.t's are like a file "stat":
  - a create time
  - a last-modified time
  - a deletion time (since the events are historical)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Database: fold_over_recent takes a function with the same signature as fold

Previously fold and fold_over_recent used a slightly different permutation
of arguments in the function being folded over the data. The OCaml stdlib
convention is to have a function (key -> value -> 'a -> 'a) so we follow
this.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Database: split Table.fold_over_recent into fold_over_recent and fold_over_deleted

This allows fold_over_recent to have the same signature as the other
functions with the same name. Tracking of deleted references (without values)
is specific to the Table.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Database: fold_over_recent have the same signature, so put in the common definition

Now that all the common MAP instances have the same fold_over_recent signature,
we can share the definition and avoid people playing "spot the difference"
with a complicated type.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Database: remove the errf from fold_over_{recent,deleted} as no-one was using it

To define an error case from a fold you can either
- turn the accumulator into a result type and return `Error
- throw an exception (... and document this and guarantee to catch it)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Database: add missing license headers

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