Do I get anything from mastering in a class? Or should I just find a good loadout and get xp by playing more? Is there something like challenges, where if you master a weapon you get like 1000xp?
No, there are no extra hidden bonuses or rewards for fully unlocking a class, other than whatever the individual upgrades provide. However, it's a good idea to max out anything that you actually plan on using.
You can earn Badges (like achievements), which provide one-time XP bonuses, but these are awarded through gameplay, not completing upgrades.