Fix rectangles serialization

[#53941171]
Add test of rectangles MML->JSON conversion and serialization

[#53941171]