Cache bidirectional enum mapping.

Not sure if this'll gain us much, but it's probably best to cache as
best as possible at the db level.