apply separation of concerns pattern for index.jsp and all js files

Change-Id: Iaf4d7f165ad65eb3510a3266acee9ebd682dbcf3