[FIXED JENKINS-15120] Prefetch related classes to speed remote class loading.

This implements the first option of [JENKINS-15120](https://issues.jenkins-ci.org/browse/JENKINS-15120).