Added tests
Fixed the preservation of extra top level keys

The logic was preserving extra keys added manually in the generated file
but was not copying extra keys written in the dist file
Fixed the cascade renaming of params

This allows supporting the case where param1 has been renamed to param2
and then param2 renamed to param3 later, and you want to let the renaming
map handling updates from a state where param1 was still used too, by
renaming first to param2 and then to param3 (the order in the rename map
is important).
Create the folder of the generated file if it does not exist yet