Improved output of KSP monitor

The KSP monitor class now has __enter__() and __exit__() methods so that it can be used as a context manager. This allows printing out summary information if the verbosity level is set to 1.