added some linker options to reduce size of final binary
cleaning up a bit in ir.c
playing with protothreads a bit