Preliminary refactoring. Cleaning up the code for reading and writing GIF files.
Refactoring to remove code for reading and writing files according to the spec from the rest of the logic.