Optimize mouse code, add notes.
Janitorial, whitespace fixes. No new code.