Add compare, json encoding, and repr()

Convenience functions
Code review comments plus JSON decoder
Merge pull request #31 from subutai/add_compare

Add compare, json encoding, and repr()