Add tests for to_hash, as_json, to_json as from_json methods.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>