Don't use array_merge with numeric keys, since the numeric
keys from the first array are overwritten by those of the second.

See also commit 87c73b46531db18.
Various minor changes (formatting, comments, etc.) no functional
changes intended.
Move contest{problem,team} table to keep table list sorted.
Repair contest simulation script by readding option parsing
and add option to specify contest (defaults to single active one).