encoding/decoding tables: give better names, mark const
test: move main() to end, remove forward declarations

By defining the bodies of the static functions before they're used, we
can remove their forward declarations.
Remove Duff's device for more conventional layout

The for() inside the switch() wasn't a "real" Duff's Device anyway since
it did not contain any logic. Move it outside the switch() to make for a
more conventional, idomatic layout.
README: explain design choices, add streaming example