Sharp Global well-posedness for KdV and modified KdV on $\R$ and $\T$