java_loxi: Major improvements / rewrite

Reviewer: @rlane @yotamhc

This is mainly java-backend stuff -- Rich, I don't expect you to be super-interested in it, but if you have time to take a glance I'd be obviously interested in any feedback.