Java thread

Merging the native to java thread migration into the trunk.  There are to many platform deponent thread issues to address when dealing with jni and the jvm.  This should resolve issues like bug #27 form cropping up.