Move some implementation from expr.h to expr.cpp.