Codegen: State monad

Change the code generator to use state monad to simplify our life when
we add support for binary expressions. State monad makes it easier for
us to expand statements and expressions into multiple LLVM instructions
without having to join the return value lists together.

The design was inspired by Stephen Diehl LLVM tutorial:

  https://github.com/sdiehl/llvm-tutorial-standalone

Signed-off-by: Pekka Enberg <penberg@iki.fi>