Added basic horizontal / vertical deadzone for zoomable scrollbar.
This should help prevent accidental zoom in / zoom out operations.
General code cleanup.
Added some utility function for last / first index.