fix for karma cont.

- we can't perform async loading in controllers/index.js. Therefore, we
add a service 'JSLoad' to switch loading mode in controllers/index.js.