Integrate CompileState into the testframework

1. Integration of CompileState  into the testframework so the tests can
inspect compilation status
2. Remove BuildStatus from Core as it is only used at compile time