Add print_mac utility function for printing mac addresses.
Fix signed-ness and integer size management for generating nodeid from mac address.