A Functorial Approach to Reductions among Decision Problems