+1 for
http://www.highrez.co.uk/downloads/XMouseButtonControl.htmRuns on Windows XP => 10. Lets you remap mouse buttons (and the wheel) on a per-application basis, including fancy stuff like sending key sequence macros, and using a button as a 'shift' to change the action of other buttons.
The O.P's requirement can easily be handled by mapping one of the extra buttons to disabled so it can be the thumb resting position, and the other to shift left and right to be forward and back, if its desired to retain the forward/back functionality. However I find browser forward/back mouse buttons are a badly thought out idea that make it far too easy to accidentally leave a page that doesn't preserve state, e.g. loosing your playback position in a video, or the contents of many partially filled forms.
I *ALWAYS* buy five button mice as XMouse Button Control's and customisation and macros vastly reduces the amount of keyboarding I need to do in many applications. I *NEVER* use a 5 button mouse without XMouse Button Control. If you forced me to, I think I'd resort to superglue!
IIRC DPI changing by button is usually handled in hardware or via a manufacturer's custom driver so doesn't get seen by the OS as a button press so if you need to intercept that button and the manufacturer hasn't given you that option, you are S.O.L short of hardware hackery.