Fix bug when encoding %00 in name component. Add helper functions to Name prototype.