restructure js libraries, register scripts and styles