<Purpose> 
    Recursively merge mergedict into originaldict.
    We assume that there are no conflicting modules here.  
    Be sure to check that there aren't any collisions!
    
  <Arguments>
    originaldict: The commanddict to merge to.
    mergedict: The commanddict to merge from.
  
  <Side Effects>
    Originaldict will contain all command entries in mergedict.
    
  <Exceptions>
    There shouldn't be any...
    
  <Return>
    None

def merge_commanddict_recursive(originaldict, mergedict):
  """
  <Purpose> 
    Recursively merge mergedict into originaldict.
    We assume that there are no conflicting modules here.  
    Be sure to check that there aren't any collisions!
    
  <Arguments>
    originaldict: The commanddict to merge to.
    mergedict: The commanddict to merge from.
  
  <Side Effects>
    Originaldict will contain all command entries in mergedict.
    
  <Exceptions>
    There shouldn't be any...
    
  <Return>
    None
  """
  
  """
  Every command in the mergedict should be placed into the original.  
  We do not handle the case where a shared node is defined on both sides.
  That check is done by ensure_no_conflicts_in_commanddict().
  We make a deep copy of mergedict to make the deletion case easier.
  """
  for commandnode in mergedict:
    # Trivial case
    if commandnode not in originaldict:
      originaldict[commandnode] = deepcopy(mergedict[commandnode])
    
    else:
      # Shared node exists in original but is not defined
      # Replace properties if they exist, and then merge over the children.
      if not is_commanddictnode_defined(originaldict[commandnode]):
        for entry in mergedict[commandnode]:
          if not entry in ['children', 'module']:
            originaldict[commandnode][entry] = mergedict[commandnode][entry]
      
      merge_commanddict_recursive(originaldict[commandnode]['children'], mergedict[commandnode]['children'])