Move code for problem management into a separate class.

This makes some of the internals simpler and testing easier.
Update tools to use review.Problems.