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