Refactor logic into compass js and adjust mouseWheelHandler tests to it