move file IO functions from misc2.c to fileio.c
move error msg related fns from misc2.c to message.c