change publication strategy

Instead of using a thread-local to track publications, we now only allow the root entity to emit a publication, and we now guarantee the root entity is always changed if any of its descendants is changed.
add a rake task to add topics to root entity types