fix worker specs

* class variables were leaking into other specs
* java exit was not stubbed
* using rspec 3, fixed a few deprecation problems