Factor JS into a separate file.