Refactoring 'DigitLexer'; adding tests