refactor ProgramLoader, RunProcess to remove static state

**please review**
This looks better than `DefinitionLoader`. Do the same as here.