Heavy refactoring, enhancements and testsuit for the initscript

I removed the "env" file and its logic because this file increases the complexity.
(Especially on cygwin)