Replace underscore with `defaults` and `foreach` modules.

Replace underscore with `defaults` and `foreach` modules.