Add a binary mode to utils.read_file.

This will be needed for #325.
Save version to state config.