Avoid generic collections operations hot paths

 - Use a specialized version of List#{map, collectFirst}
   These special case mapping over an empty list and avoid
   allocating.
 - Avoid nonEmpty in favor of `ne Nil`

I see in the order of 2% speedup.

Perhaps more useful is that
these methods no longer dominate the YourKit profiles, even though
profiler bias due to safepoints at allocation of the ListBuffer
might have been overstating their significance.
Merge pull request #3444 from retronym/topic/opt6

Avoid generic collections operations hot paths