Minor improvements and refactoring.
This commit is being done mainly in
order start a major branch.  So this
commit will be the new major reference
trunk.