code formatting and comment standardization #2797

#2797

No code changes, just formatting & comments.

After build passes, please review and merge, to keep actual logic changes in a separate PR.