Fix JENKINS-21507, adds FreeBSD support

This should solve for [JENKINS-21507](https://issues.jenkins-ci.org/browse/JENKINS-21507), and contains a number of other minor cleanups.

I wrote a Javas, yay!

![cool java](http://revimgs.bevnet.com/media/cool_java/cooljava_frenchvanil.jpg)