Added replace_path

returns a modified object. Replaces the entry at 'target' with 'new_val'