JNI cleanup: keep VM thread attached for its lifetime
Add preferences API