Refactored to be interfaces.

Also, using the built it IReadOnlyDictionary instead of
ImmutableDictionary to reduce the number of dependencies.