Merge pull request #5 from mbaron/master

Split calculation of rects into a separated class and add tests on these new methods.