Singularities of linear systems and boundedness of Fano varieties