Add JSON encoding.
Rearrange scripts. Run some experiments.