Optimized scripts using requirejs and r.js

-
Added requirejs and optimized.

Also added if local function to dev development
Merge branch 'Required'