Protein flexibility and dynamics using constraint theory