A whole lot of refactoring.
Update tclib.