Fix comment about number of data words, 0..16 -> 0..15
Change state machine branching from if's to case statement