Another thought is that you're gripping the bars too much under heavy braking. By trying to engage your core and/or grip the tank with your legs, you can relax your arms and let the bike do all the work. If you're putting weight on the bars ie. Arms are stiff to help stop your body sliding forward under heavy braking, then you're preventing the front from moving to compensate for the forces over braking etc. Resulting in that force being transferred to the rear, hence the rear moving around on you.