Factored out placement checking

Also includes merge commits from latest upstream expr-v2 branch.

This moves the bits of `placement_finder` that I think we're going to re-use into a separate file so that we can access it directly.