Refactored some code
Separated send_err and send_pl functions into isolated files.
Updated documentation for msgio.c