Put mode in its own table, explicit function to change it
Make mode change just immediately exit
Fix indentation that was 2 spaces to 4
Now mode change exits immediately, no need to pass in ONETIME
Parse command line command in one place
Make mode change an explicit command
Factor out commands to front of scrape command
Pull out each command into its own function
Remove a use of global window_start/end
Slightly less confusing window logging
Separate logging into section
Combine forward and backward code, removing duplicate
Function to change window
Save window in own table and remove global variables for window_start/end
Simpler logging of window position
Bit of tidying and commenting
Minor indentation fix
Read mode
Remove broken max/min of strings with numbers in them for alternatives
Add lock code, using flock to make sure only one at once