The private function `illegalName` was converted into a public function.
A new public getter function `usedNames()` returns a reference to `m_usedNames`.
A public function reset that would change all `m_usedNames` to *only* the names that are used in the
AST. Also resets the counter. This will be used before the final NameSimplifier step in the
optimization phase.
The first two functions were added so that `NameSimplifier` could use it instead of traversing the AST
using `NameCollector` to find used names.