Fix JRuby install on systems with non-BSD `sed`

There doesn't seem to be a way to construct a sed invocation for
in-place editing that is compatible with both BSD and GNU sed.

http://stackoverflow.com/q/5694228/11687

Fixes #475
Thorougly test JRuby install process
Merge branch 'jruby-sed'

Closes #476