Rename leaveDocument to exitDocument
Fix exitDocument to work bottom-up

When a component leaves the component tree all its children will have their exitDocument called in a bottom-up way.