Add popcnt and hamdist functions