Refactor handling of first-time visits to topics.

If we use default values on a dictionary, we don't have to manually specify
them ahead of time.  I also reversed the boolean operation because it seemed
clearer that way, and allows us to use those defaults easier.
Add vim modeline.
Minor cleanup.