Refactored more code. Cleaned up some areas and made them more
consistent. Added more comments to all the code relating to NodeGroups.