wmflib: add apply_format()

Applies a format string to each element of an array. For things like:

  apply_format('/etc/apache2/%s-enabled', ['sites', 'mods', 'conf'])

Also useful for formatting arrays of numbers or IPs. Unlike map(), doesn't
require the future parser, and won't kill performance. :)

Tested on vagrant.

Change-Id: I2323319baefb3274cc42eb40a14b3ad57586b042