Minor simplifications and code dupe reductions in codegen (#938)

* use ir::Receiver ToTokens impl in codegen

* slightly alter codegen of fn definitions in item impls

* impl ToTokens for Visibility and use it in codegen where possible
22 jobs for master in 30 minutes and 43 seconds (queued for 5 seconds)