Lib JVM (#294 with extra fixes)