Refactored codegen functions under enclosed scope.
Refactored codegen functions under enclosed scope.

Encapsulated the recursive codegen functions in a local scope which is implicitly closed over the context/module/buffer pointers, removing the need to pass around and unpack context objects all over the place.

Former-commit-id: 7afa7f237308d8d73498e651957b484ac0bc8a7e
darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide