Move client-side JS to file