Add sequential RCM on CPU.

Also change the parallel algorithm a little bit to remove a large
overhead.