Generic code needed for implementations of hierarchical coreference.

Primarily since Mike and others still depend on the code in .bib, I
haven't wiped out the original hcoref quite yet for fear of knock on
effects. The sampler in hcoref is deprecated and .xcoref contains the
new implementation.