[WIP] Add per-file coverage.

Work-in-progress PR. This will eventually be rebased in a new PR against real upstream master.