Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@ Z.M. The more general van Kampen theorem in his 1932 paper does not make use of groupoids, which are a more recent concept that I believe arose (at least in topology) after category theory began to be developed. Van Kampen's paper only talks about groups, particularly groups defined by generators and relations.
This argument proves the general fact that an incompressible surface in an irreducible 3-manifold, with the boundary of the surface contained in torus boundary components of the 3-manifold, is either boundary incompressible or a boundary-parallel annulus. This is Lemma 1.11 of the current version of my Notes on Basic 3-Manifold Topology, available on my webpage.
For the second variant, there is some discussion of HNN extensions in Example 1B.13 of my book, but this doesn't quite give what you're looking for. I'll try to include this somewhere in the revised edition.
As Andy Putman said, the CW variant is in my book. It's in the paragraph following the proof of Proposition A.5 in the Appendix. The book should have included a cross reference to this in the discussion of van Kampen's theorem in Chapter 1, but I'm revising the book and will add a cross reference.
In dimension 2 the result is older than the Earle-Eells paper which was published in 1969 and which focuses on surfaces of higher genus. There is a paper by Smale in the 1959 AMS Proceedings that proves the stronger result that Diff$(S^2)$ deformation retracts onto $O(2)$. For the $\pi_0$ statement Smale cites an announcement by Munkres in the 1958 AMS Notices.