some general cleanups

These are mostly style related and have no behavior changes.  Just
want the code to be in a really nice state now that we are approaching
a 1.0 release.