I would advice you to learn till C1 level. B1 is not enough and Bachelor in Math is mostly in German and you must take TestDAF, so I think you should spend one year or so clearing upto C1 and TestDAF, which is highly advisable. But you can also do the same in Germany, but you have to spend more money in Germany. Since your German level is good, maybe you can find a part time job, but that's no guaranteed thing.
Math is normally exclusively taught in German and it's not the simple kind of German, either.
I came to Germany in 2001 to work as a scientist knowing no German at all. It worked out pretty very well for me.