Blob layer fixes

Looking at individual commits is probably more enlightening than the final. Particularly 76bd9ed and dcc1c5a, where the bugs are fixed (attempting to Tuple.unpack `null` and non-blob keys, respectively).

Most of the others are adding tests and minor defensive tweaks to the layer consumption.

The last commit is a large amount of cleanup: add final to data members, remove unnecessary casts and type parameters, remove needlessly verbose comments and minor consistency tweaks.