Doc layer working more or less as expected now with a few tests.
Realised I could use a common Node type for Kind and Doc objects.  The
fieldmap in Kind can be used for a schema.  Needs code clean up and
complete separation of doclayer.go from rest, and some more
documentation.