Better scroll event handling

I moved the event type detection in the initialization to do it only once and then used a specialized function to return the delta values on scroll.
Added the standard WheelEvent detection for modern browser too and fix horizontal scroll for Firefox.