Cleanup: Merge all code from main.cpp into unit test tstestapp.cpp
Summary: Also improve the documentation
Reviewers: Kate, dhaumann
Reviewed By: Kate, dhaumann
Subscribers: dhaumann, kwrite-devel
Tags: Kate
Differential Revision: https://phabricator.kde.org/D16215