Use map of shared_ptr's for ContextMap instead of ptr_vector's.