Fixing dynamic expansion issues

This PR fixes a few issues caused by dynamic sub-graph expansion.
This includes #555 which causes double deletes, create-before-destroy being ignored
in some circumstances, and instance diff handling when they are non-homogenous.