Integrate with new hooks model in core.

This involved some significant changes to the legacy
formatter, because when a hook step describes its source, it will not
describe any background that the feature has. This means that if you
print a scenario as soon as you hear about it, you may be printing it
prematurely, since the scenario is just information about the hook, but
not the next node to be printed.

What I've done is to cache the parent nodes of a step like scenario, background,
scenario outline, examples table etc and only print the parents when the
step is printed.

I've also added some more test cases to the legacy formatter specs.