Making targetDirectory configurable.

I added the ability to override the `targetDirectory`, along with a test of same. Had to convert `targetDirectory` from static final into a member variable.