Add a class for generating random identifiers

Will be useful for all kinds of things, but brought about in discussions
specifically for Util::EXE in #2037.
Make first char's character class configurable
Store inverted hash for better lookups

Also clarifies comment about infinite loops
Land #2087, @egypt's random ID generator