Added 'reduce' function to runtime lib.