Anaphora resolution preliminary work

I am creating a pull request so that I can comment on the code line by line.

This should *not* be merged at this time ...