Add support for 'rect' objects

I saw the function for rectangle was missing, so I implemented it. But it won't work with percentage values.

I've used some of your work for one of my repo, so if you fancy I can try bring some of my tests and class logic to yours. But it might change your code structure.