A commander also needs a remote light or two in order to do anything useful.
The SB-700 speedlight can be a Commander, but the D3100 cannot be a commander. Not meaning to be spoil sport, but the flash is sort of an expensive commander, since Commander has to be on the camera (not always the best place for a flash, possibly sort of wasting a flash, so to speak). Alternately, the SU-800 is a Nikon commander that costs slightly less (is just a commander only, does not include a flash unit), and the SB-700 could then be a remote flash.
Plus, SU-800 has a couple more commander options too. SU-800 supports three remote groups (SB-700 two remote groups). And SU-800 groups can all be different flash modes (SB-700 groups must be same flash mode).
Note too that the camera bodies with Commander also have FV Lock, and those cameras without commander do not have FV Lock. FV Lock is very useful to avoid pictures mostly of the subject blinking at the commander. See
Using the Nikon CLS Remote Wireless Flash System
It seems pretty important, and one opinion is the money spent for a commander might be better spent as a camera upgrade (with commander), which also provides FV lock, and possibly a few more things.
However, the SU-800 uses invisible infrared light, and won't make the subject blink, meaning FV Lock may be less important then. The remotes do still preflash for TTL, which can cause blinking, but maybe not as big a problem.
The Nikon SB-400 is a very simple flash. It has no menu itself, and must use the camera menu (to be a flash), so it must be connected to the camera hot shoe to work at all. SB-400 does not support use with the commander.
The only way to use a SB-400 and SB-700 together would be SB-400 on hot shoe in Manual flash mode. The SB-700 could be in SU-4 mode (optical slave), triggered by the flash from the SB-400.