Fixed scrolling bug, refactored code

Refactored init() function into several smaller functions:
  setupStructure()
  setupStyling()
  next()
  previous()