Extract some opal fixes to upstream opal corelib