  Observations of the CMB today allow us to answer detailed questions about the
properties of our Universe, targeting both standard and non-standard physics.
In this paper, we study the effects of varying fundamental constants (i.e., the
fine-structure constant, $\alpha_{\rm EM}$, and electron rest mass, $m_{\rm
e}$) around last scattering using the recombination codes CosmoRec and
Recfast++. We approach the problem in a pedagogical manner, illustrating the
importance of various effects on the free electron fraction, Thomson visibility
function and CMB power spectra, highlighting various degeneracies. We
demonstrate that the simpler Recfast++ treatment (based on a three-level atom
approach) can be used to accurately represent the full computation of CosmoRec.
We also include explicit time-dependent variations using a phenomenological
power-law description. We reproduce previous Planck 2013 results in our
analysis. Assuming constant variations relative to the standard values, we find
the improved constraints $\alpha_{\rm EM}/\alpha_{\rm EM,0}=0.9993\pm 0.0025$
(CMB only) and $m_{\rm e}/m_{\rm e,0}= 1.0039 \pm 0.0074$ (including BAO) using
Planck 2015 data. For a redshift-dependent variation, $\alpha_{\rm
EM}(z)=\alpha_{\rm EM}(z_0)\,[(1+z)/1100]^p$ with $\alpha_{\rm
EM}(z_0)\equiv\alpha_{\rm EM,0}$ at $z_0=1100$, we obtain $p=0.0008\pm 0.0025$.
Allowing simultaneous variations of $\alpha_{\rm EM}(z_0)$ and $p$ yields
$\alpha_{\rm EM}(z_0)/\alpha_{\rm EM,0} = 0.9998\pm 0.0036$ and $p = 0.0006\pm
0.0036$. We also discuss combined limits on $\alpha_{\rm EM}$ and $m_{\rm e}$.
Our analysis shows that existing data is not only sensitive to the value of the
fundamental constants around recombination but also its first time derivative.
This suggests that a wider class of varying fundamental constant models can be
probed using the CMB.
