I don't think you will need to reinstall Safari.You should only do this in case safari application has become corrupted.And as per Apple you can not reinstall Safari, you will have to reinstall the OS X.But there are workaround you could use to reinstall Safari.ฤก. I think your computer is infected with Adware or Malware which you should completely remove manually as mentioned by Barney. If you tried to remove Avast by dragging an application to the Trash, you'll have to reinstall it and then follow the instructions linked above.
Never install any "anti-virus" or "anti-malware" software again. Please back up all data, then remove Avast according to the developer's instructions.
In short, apart from the fine print in the license agreement, Avast is indistinguishable from malware, and is arguably worse than any known malware now in circulation. Some versions of the product also inject advertising into web pages. Removing it may not repair all the damage. Not only does it fail to protect you from any real danger, it may send personal data (such as web browsing history and the contents of email messages) back to the developer without your knowledge, give false warnings, destabilize and slow down the computer, expose you to network attack, and corrupt the network settings and the permissions of files in your home folder. "Avast" is the worst of the whole wretched lot of commercial "security" products for the Mac. Sorry I did not keep better records of exactly what happened. I have late 2013 27" with 3.2GHa i5 and 16GB and NVIDIA GeForce GT 755M 1024MB. Things still seem to be working a little slower than they should. I guess I don't make the distinction of malware and virus. Sorry I can't remember the virus that Avast found. I opened Safari today after getting your email, and got the blue wheel going for almost a minute - then it seems to be working ok, so I am at a loss. So for about 6 weeks I have closed it any time it tried to open, and I have used Mozilla. Safari still did not work and gave me pop up windows. I installed Malwarebytes Anti-Malware and ran it and it sped things up. I just closed Safari and started using Mozilla, since I had updated the OS and Avast was not working. It is one of the big name common ones that has been around for several years in slightly different variations. If I tried to exit it kept making more pop up windows.
I updated the OS and ran Avast and found a common Russian trojan (if I am remembering correctly). First Safari started always sending me to a website.