Finishing up refactoring. Most of the code dealing with specifics of the gif format has been moved into spec.py.