fix counter for problems

Make counter for problems behave more nicely.  Also move all commands to
command.tex
Merge pull request #77 from ayr0/counter

fix counter for problems