Don't modify functions while iterating (#543)
Don't modify functions while iterating (#543)

Fixes #541

* collect function list first, then replace usages with new vectorized version
* fix iterator usage while replacing uses
google/clspv,google/clspv,google/clspv,google/clspv,google/clspv