(refactor) Give plugins a mutable reference to the extended type in eval.

This is mostly to allow for nested plugins using the caching interface,
which is incidentally disallowed if plugins can only access the extended
type immutably.