Maximal freedom at minimum cost: linear large-scale structure in general modifications of gravity