Move page js out to files