Fix system command in JRuby

by passing ENV vars as the first arg to system as a hash, which is the
recommended way.
Also, clean up some code.
Merge pull request #3 from code-mancers/fix-jruby-system-command

Fix system command in JRuby