Underscore.js: typing the reduce method to work with various collections