Initial named args implementation
Cherry pick 7682dfc by stas

Minus whitespace changes, minus some things not relevant here. Not
carefully reviewed. Might contain some changes that do not apply
to my branch and need to be removed