About the versions package that allows optionally including/excluding {environments}.
The versions package provides tools for marking changes to a LaTeX document as belonging to named revisions of the project. This is to be distinguished from using revision-control software such as Git (see revision-control for that).