Replace VM magic with class loader based patching