refactor ProgramLoader, RunProcess to remove static state

**please review**
Is this error message correct?
It doesn't make too much sense to me.