Move stuff out of the ever-growing Gif class.