Added mathematical bits for rotated rectangles

Sorry for the delay - on holiday!
We are preparing to use rotated rectangles in the various colliders.
They will also be scaled. This is for two reasons:

1. Calculating a new inner collision representation for each degree
of rotation or factor of scaling is painful. Instead the inner collision
representation should be rotated/scaled along with the image.
2. Views must be able to rotate. This is hugely painful if you do not
permit rotated rectangles normally.

This will require some major refactoring, but the core
structure of the application remains the same more or less. The
major change is the representation of rectangles. They will use
doubles for their position, and be represented by:
(centre,size,rotation,scale)

Scaling will always be applied before the rotation. For more complex
transformations, you might not get rectangles at the end.
Such transformations can be supported by constructing whole new
images, but it's slower. In practice, I doubt people will use more
general transformations anyway.
Added test and fixed extra maths module

The complicated maths bit has been written and it now appears to work!
It will be a bit slower, but with the help of heuristics it should
still be fairly close to its previous performance.
Setting up the dynamic collider