Swapped Qwt plotting for matplotlib, rearranged quit handling.