Optimize classloading and bugfix for newinstance()

Add optimization for production systems for bootstrap classloading, and on the go add a bugfix for newinstance() (which is independent, actually).