Add Name.compareComponents helper function.