Added rotate option and calculateRotatedBounds method to Entity.