Added hasName method to Router as requested in issue #4784

Just a quick addition from a request. Let me know if anything needs to be added or otherwise modified.