refactor ProgramLoader, RunProcess to remove static state

**please review**