Splits execution plan building into discrete steps
Merge pull request #1110 from systay/phases

Splits execution plan building into discrete steps
Disable constrained changes when underlying index is failed.

Add test to verify that changes are prevented in this situation.
Currently the reason given in the exception is incorrect; this will
be resolved when we properly separate schema and data changes.