Thp script environment handling is broken

The environment handling is broken for scripts in a Thp package for some now obvious reasons.

Also, I decided to start from the process environment rather than an empty one, because in Windows you need certain things around for process to actually execute.

A possible fix for this is in my branch fixenv.