[TIMOB-14978] Moved legacy.js code into the titanium.js file. Fixed bug with legacy builds not working.