Refactor persist_blocks, simplify array packing/unpacking

Working with the inputs and outputs of the block requires a bit of
care when there is one input or output element.  For example one input
could be confusingly packed into an array.

Also add some code to display the length of output items.