First draft of #10.

Currently only JSON-based, not yet finished. WIP