speed up _.each

use `_.keys` instead of `for .. in ..` loop and `hasOwnProperty` check. Like we did in #1224 and #1223