first round of refactoring and comment insertion done, also fixed problem that icons were removed when merging pdfviewer-patrick with master