Split PR merge operation in 2 steps to reuse commit() logic

Rename high-level merge() function into merge_candidates()