The Effects of Environment on the Evolution of the Galaxy Stellar Mass Function