Add problem generator and clean up code

I added a problem generator that will give appropriate random problems
for each grade level and cleaned up some of the old code.