Non-chunk-specific logic in jvm compilation now in prepare_execute.

- Fixes the global analysis splitting bug.
- Classpaths are now modified once, up front.

(Previously the classes/resources dirs were added to the classpath
multiple times, once per chunk. Also, there was some bogus logic
that updated the classpath at the end of execute(), implying that
the update was only for downstream tasks. However the update would
be visible in the next chunk, so that was misleading, and also
led to the first chunk being 'special'.)