Implements recursive doubling algorithm for MPI_Scan and MPI_Exscan. The algorithm preserves order of operations so it can be used both by commutative and non-commutative operations. Signed-off-by: Mikhail Kurnosov <mkurnosov@gmail.com>