greatly simplify dirty_every_other_page

Also fixes an overrun.
fix another write past the end of array
do the same simplification to read_every_other_page
fix read past end of buffer.