Allow giving names to traces and metrics, and print them when pretty-printing

Fixes https://github.com/numenta/nupic/issues/1374.
Builds on https://github.com/numenta/nupic/pull/1371.

@subutai