fixes the exec() command and refactors the code

Fixes the exec() command which was missing a "cmd.exe /c" to be able to
execute any kind of bash commands, and not only programs.
Also adds some comments and more intuitive log messages.
Also adds a .gitignore. Feel free to add rules to it.