Add a `contains` method.

I also switched the order of type params to `<K, V>`, which feels more natural than `<V, K>`.