Add compare, json encoding, and repr()

Convenience functions
perhaps just `return self.termJSONEncoder()`?