Fixed inheritance for proper overrides/nesting and added logic to merged nested dicts 

Updated to properly inherit everything within key 'enc' from inherited nodes recursively, with the input node taking priority, and cleaned up functions