Significant documentation revision, fix compiler warnings, write undo-test-region-example