Add test for encodeFile and decodeFile.

Issue #22.