Added convenient methods toString() and toJson().