Flash saving optimisations

These couple of small commits save a small number of bytes of flash memory used by the library by reducing the size of a few storage types and reversing the repeat counting condition in the transmit code.