Split JS to several files for improved modularity

Change-Id: I389cec418be72b3b021404abb7b0b530f71dd50f
Merge "Split JS to several files for improved modularity"