Metastable, partially folded states in the productive folding and in the misfolding and amyloid aggregation of proteins