Added dir_restore decorator that restores the directory from before when the
function was called, after the function is done.
Made get_injections use more iterators.
Fixed: bug in that the last entry was being removed before sorting
Fixed bug in merging: chdir to dirname not basename.