More code changes

Extract RequiredCharacters class, rename to RequiredChars. Some minor changes.

Still not functional...