One or more messages consisting of an Address Codeword and one or more Message Codewords

Synchronisation Codewords at regular intervals between the codeword batches,
to keep the receivers in sync with the ongoing transmission

Idle Codewords before,
between and after the messages,
for mandatory padding to correctly place the Address Codewords in the correct frame boundaries.

Because the preamble is long,
it makes sense to send a large amount of messages in a batch to minimize transmitter key-down time and save RF channel time.
Also,
having a larger number of messages to transmit in a single transmission makes it possible to reduce the amount of Idle Codewords in the transmission by optimizing the order in which the messages are sent.

This module currently has a very simple optimizer,
which does not do a deeper search for the most optimal transmit order,
but instead only considers the next message to be transmitted based on the minimum amount of Idle Codewords needed before the address frame for the next message can be sent.

Unless a debugging mode is enabled,
all errors and warnings are reported through the API (as opposed to printing on STDERR or STDOUT),
so that they can be reported nicely on the user interface of an application.

The function returns the binary string to be keyed over the air in FSK, and any messages which did not fit in the transmission, given the maximum transmission length (in bytes) given in the first parameter. They can be passed in the next generate() call and sent in the next brrraaaap.