Abstract and decouple path selection from circuit construction

For legacy/trac#9001 (moved), we first need to abstract the existing path selection mechanisms and make sure they are tested and equivalent.