Perf ideas.

o Replaced funky dictionary manipulation with a list comprehension.

o TODO: Performance of the O(n^3) exists_anywhere() method needs to be replaced
  with hash lookups.