Rename generator-ended to stop-iteration; tweak library headers