Moved code into an ios subfolder in preparation for adding the Android version's source. Fixed some modern syntax warnings too.