Statistical mechanics of simple models of protein folding and design