cherry pick of [Modified jsglue so that it does not suffer from abi incompatibilities]