Add support for name hashing

This is rebase of #621.

See individual commits for details.