added require.js
added module system to existing code