Refactoring the cookie storage phase so it doesn't depend on the application closing
Taking the QApplication out of the main loop; easier debugging and testing
unittest+QTest framework template; 'does-not-segfault-anymore' version