M4 improv

Improvements discussed, separating the median calculation into four horisontal blocks. Fixes #2. Please note that this is a BREAKING CHANGE. Hash values calculated post merge will be different than those calculated before.