Change algorithm for exporting scheduled tasks to iCalendar format

Keep the old function just in case I want to return to it (commented out).