Added thread start callback to hack around a jni problem upstrem.  The solution will probably mean removing the library thread and have hook_enable block while the hook is running.  This should allow more flexible library implementation.
Various bug fixes.