Add some helpers to Rect

These will be used in rust-layers to simplify some things.
The prevailing style in our code is to write functions on multiple lines, even if they fit on a single one.