Adds inline comments, minor upgrades

I commented the TCP class, now that the structure is mostly final.  I
also made some minor upgrades to the TCP code & the expected ID min
heaps to handle edge cases & proper termination.  Fixed some typos &
renamed _env attributes to env (they should be publicly exposed)