Switching cache format to JSON

For language interoperability, data is saved as JSON. File sizes may be a bit smaller too. Resolves #5