Changed NID structure to include MAC addr. Also added more nid support functions and tests