Optimized install_mod.php to first check if that what we want to add exists or not

The same for if we hit the restore button