Refactor name helper classes a bit.

Refs #5925