Refactor complete, included changes from JaTochNietDan for scrolling fixes.