Unicode file digest

Breaks out the piece of commcare-export that digests a file so it is tested to work with all sorts of files.