Make --debug a global option and fix option description printing
Refactor script env loading