Lie algebras of differential operators, their central extensions, and W-algebras