Changes io:format output to error_logger

Printing output through io:format is messy since it can't be disabled or redirected. Calls have been rewritten to use error_logger, that supports different handlers and different degrees of severity.