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.

@jcredding ready for review.  Looks like more than it actually is.