Replaces awful connect type system with bitflags
Merge pull request #7516 from mwerezak/pipecleaner

Replaces connect type system