Split widget js to several files

WIP