added require.js lib and the logic in main.js called by require.js