Replace header() with Common::sendHeader() when possible

I did this one without edit View.php because it broke some test. I will push after that.