Set up for task 4, Moved functions back to main

The mode determines more than just how the file is written, so the
switch statement should be in main. When the task is determined it will
either write to the file or call other methods depending on the mode.

I've added in some pseudocode and updated some methods for task 4. I'll
have task 4 finished tomorrow.