Fix JSON round-tripping.

This also includes a unit test to ensure that round-tripping works properly for
those serializations where it's supported.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Refactor transaction handling code.

Instead of duplicating the calling of the transaction methods in every
FileFormat, simply move those calls into the _open and _close methods in
FileFormat itself.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Use bool(x) instead of not not.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>