Refactor Json class for json de/serialization.