Add low-level GIF writing routines, Makefile

Untested as always. Other changes:
- Remove htoxe bswap macros from binf.c
- Don't flush with 0 length from lzw_finish