Dancing around Halide limitations.

Converting expressions to functions because this makes dependencies clear.

After I will make everything compiling, I will describe every line in detail in an email message for code review.
Cryptic error message.

Sent email to Halide-dev about my problems.

Continue tomorrow.