Tidied up EntityNameMatcher and added test cases