Resolve conditionals for #extends.

I need conditional extends in order to support polymorphic responses.

Includes engine tests for #extends.