Frontend: restructure js modules