A proper and semantic typeof function that works with literal primitives, boxed objects and those from another execution context.