Initial work for refactoring the project. All changes in this branch are useful and reduce compiler warnings significantly. After testing this code could potentially be released to the app store. Other refactorings will be performed on a new branch.