[SPARK-4121] Set commons-math3 version based on hadoop profiles, instead of shading

In #2928 , we shade commons-math3 to prevent future conflicts with hadoop. It caused problems with our Jenkins master build with maven. Some tests used local-cluster mode, where the assembly jar contains relocated math3 classes, while mllib test code still compiles with core and the untouched math3 classes.

This PR sets commons-math3 version based on hadoop profiles.

@pwendell @JoshRosen @srowen
Hm, yeah, I thought Hadoop had been on 3.1.1 for a while. There's no need at this point to override it right? 3.1.1 is used everywhere. You mentioned that Breeze uses 3.2 but I think this may work just fine given its limited use of math3. unit tests look good.