Minor fixes all around.
- Modified socket_output to use the #socket_output record instead of
  the #socket_input record.
- Various fixes to file_output and socket_output to fix dialyzer
  errors.
- Rearranged tests to make them more code-efficient.