Fix coding style.
Add explanations for T2-T7.
Factor out explanations for the Q test.
Fix a bug related to dict[k] being None.