MB-100 Add ns_config:fold function.

Change-Id: Iab980bd9551a1f8688dc3354a183bab8c5a54620
Reviewed-on: http://review.couchbase.org/28184
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>