The molecular principles governing the activity and functional diversity of AAA+ proteins