Add support for per-type originating elements.

I don't think it's worth it after the switch to imperative.