Issue #82: Handle more than two numbers in ANSI sequences

FSM transitions were not set up to accept more than one digit in the
third number, or to accept more than three numbers, in ANSI sequences
such as '\x1b[...m'.  They were also not set up to capture the third
and subsequent numbers.  This fix corrects these issues and adds a
unit test.