Fix width handling code

This essentially boils down to a full rewrite of libflo, which I
wasn't really planning on doing.  I guess now that I've got an idea of
how this should be written it's a whole lot smaller... :)