Symmetric encoding/decoding

The output JSON can now be used as input JSON. Class method created to
output class from JSON string and private ivars moved to the .m files.