implement vector->for_each, use it in delete_window

* looks better now
remove const from for_each func parameter