Rework CNameDB public interface.

Rework the public interface of CNameDB to be more high-level.  Instead
of reading (and especially writing) the vector of CNameIndex objects
manually, users of CNameDB can now use PushEntry/PopEntry and ReadName
to access just the last entry.  This is in preparation to pruning.