Stateful transforms compatible with 'mgcv' R package

Hi!
I've added the file *mgcv.py* containing the code for the following stateful transforms: *cr/cs*, *cc* and *te*.
Benoît. 
In fact I first wrote it this way but since I need ``np.zeros(..)`` for ``"sum"`` in ``setdefault()`` it would get evaluated everytime, that's why I changed with ``if/else``. But I agree the idiomatic version is more readable, I'll change that!