Cleanups.

Some javadoc, some modifiers, some try-catch-with resource
to eliminate use of close calls, and synced formatter
access in AbstractMetadataBuilder.