Split code from index into stylesheet and js file