Fix issue #2 by switching to JSON.
Add simple unit tests.