Better support for hopper and hopperchain specs.

Added module-level functions to convert hopper/hopperchain specs
to and from strings.

Also modified existing tests to include testing the spec property of each hopper type
and of the hopper chain.