A huge commit. Fixed issues #13 and #14. Fixed some build errors with Qt5 and/or GNU/Linux. Code cleanup.