More work on accurate size tracking.

Still a few unclear things, and the code is a little gnarly.  But it
seems to work.