Refactor anagrams? to use two implementations for each case.

Thanks to @barrettclark for the feedback!