Add functions for finding loop headers, and for inserting loop-preheaders.

Summary: Refactors the loopVisit function into a BackEdgeVisitor helper struct.

Reviewed By: @ottoni

Differential Revision: D1541026