Add support for roll-over when files are bigger than 65536 * blksize (bis)

This a new version of my rollover patch, with tests, on top of the current master.