task: Moved unrelated code out of the with clause
task: Removed dead code path
task: Merged duplicate code
task: Moved more code out of unrelated with clauses

.. including dead code path cleanup
task: Simplified if-return statements
task: Extracted write_xcsoar/seeyou_task() functions
task: Use write_xcsoar/seeyou_task() functions instead of create_ counterparts
task: Removed obsolete create_xcsoar/seeyou_task() functions
task: Renamed "key" enumeration variables to "i"