Add first_or_none; use it wherever possible

(Reduces execution time by somewhere between 1/8 and 1/4.)