Make Rectangle and Point generic classes

Now we can express that some parameters need to be Rectangle<int> or
Point<int> objects. There are some minor breaking changes which
hopefully will not affect many developers.