Don't lose the this reference for program and compilerHost methods.

Fixes #1545