Readability / Application return code
- moved some declarations nearer to their usage
- return the code from QApp when exiting