async map-reduce functions for nodejs