Refactor main.js to separate out ScrollItemView