Tractability and Decompositions of Global Cost Functions