Refactored the name validation logic into a class

Bugfree was getting a little large, Also now uses the NodeVisitor class
from PHPParser to remove all of the iteration logic