Resolve city prefixes instead of exact matches

This basically ruins the map property and runs in O(n) instead of O(1). Need to
find a neat Trie. OTOH n is constant here, so it's probably not worth it.

Also the code is pretty crazy.

Fixes #4