Save scrolling position and restore it when going back

Patch 1-3: Clean up
Patch 4: Don't scroll in the wrong direction
Patch 5: Remove logging and fix indentation

Change-Id: I5dfa92829a11ce94c4df9bb9891715b48f2b0900