Add test for encoding in fragment. Closes #10.