Fix for "typeof" operator inconsistencies/problems in JavaScript. AMD/CommonJS/browser compatible.