Add necessary comments and update copyright.

Also some whitespace changes.