First version of Java bindings for libudi.

Fixed some misc. bugs uncovered by Java bindings.