Write to gif instead of console

I implemented some quick code to generate an animated gif from the sorts.  The gifs respect the max, count, and mode flags, but there is no way to switch between gifs and the console output; that wouldn't be difficult to add.