Non-functional cleanup.

 - Mark some fields private/protected and/or final
 - do assignment with declaration if possible
 - cleanup constructors where possible
 - use immutable structures for some read-only fields