Cleaning up the object caches and decision stack once the end of the
document is reached.

The element-traversal list will remain ... not sure if it will be used
after.