Replace elaborate fold by much simpeler flatmap
Modified piqic-ocaml to generate a separate module for every record,
which uses the same names for the constructor, serializer and
deserializer, and which also generates getters and setters.