Fix bug in go anagram example; add tests. See #448.