Added a character stream generator with memoized lookup.