Fix cache bug
Added shell support for jruby.
Improve shell tests.