Allow containers as clipping mask

WIP. Needs lots of tests.