Improve JRuby compatability and cleanup CLI