relocator: add \(i)clip support to the mask operations; refactor mask operations a little