modularize js code with requireJS.