How one school ditched drugs and violence to become a ‘grammar school’