ex/init: Fix manual find/contains loops; move strs
Replace the manually-rolled loops with std::find(), made nicer by adding a contains() helper function, which can eventually be replaced with std::ranges::contains in C++23 (once all supported compilers have that).
Since we loop over temporary vectors, we can/should move their elements into our containers, instead of copying them.