Here comes the first part of a GIF decoder. It decodes up to the point of gathering all the LZW-compressed data. The next step is to implement decompression, and then turn the decompressed data into a bitmap using the color maps, etc.