First refactoring of main.cpp to use QSharedPointer for class instances.