Update coder.py

Move the writing of extra_source codes(i.e. initializer, looper) after the variable declarations so those variables could be used.