Remove trait CtxMethods  - work towards #11474

Remove the trait CtxMethods and convert all methods to functions. The diff is a little hard to read, but I tried to do very little apart from indenting and editing the  lines containing "fn"

This is work towards #11474 : Initialize BuildContext/WorkCache later in the build process