Split shared js implementation into multiple files and assigned them to folders according to their responsibilities.