ExitStack and function to display a pmf in a LaTeX array.

Add a function to display a pmf as a LaTeX array.  
Add ExitStack so that we can use multiple context managers uniformly across Python versions.