Simplified definition code, changed Node.js detection to global "window" variable detection for better reliability and compliance with component.js.