Clean up minor linting issues, update final console.log to use custom log function, update error in connection.on('close'