Integrate the legacy context-common code and headers (1/2)