Expand repository source and checkout subdirectory

This allows environment/build parameters to work (required for inheritance plug-in).

My previous pull request for this was rejected because there were a few ends not tied up and there wasn't a unit test provided. I have spent tonight finding out how to create a unit test, and hope the provided one (EnvVarTest.java) is suitable. The idea is to clone into a subdirectory of the workspace, where the subdirectory is provided as an unexpanded environment variable. With the rest of my changes, this will be correct expanded allowing the build (and subsequent builds thereafter) to work.