Fixed tests, which broke due to the sbt update
Added new phase
First iteration of adaptation

Doesn't recurse deep in the tree