Parallel scan algorithm

Added multi-phase segmented scan based on Blelloch algorithm.