Refactor installation scripts

 Refactor Mac installation, with Debian installation model :

- Improved error checks during installation/uninstall
- Added new log functions (with a log file)
- Fixing some bugs