First stab at adding Java SWIG support.

Also moved stuff around.