clean up files and add global login JS to each page