Rewrite the flatten transform/clip code to more clearly separate local …
transform/perspective and world transform/perspective. Addresses servo/servo#11650.