Better support for hopper and hopperchain specs.

Added module-level functions to convert hopper/hopperchain specs
to and from strings.