Fundamental groups of rationally connected varieties. Brauer-Manin obstruction for integral points of homogeneous spaces and representation by integral quadratic forms. With an appendix by Dasheng Wei and Xu 