Major improvement to NIOS main.c

draws only changed pixels at buffer swap. Grid fixed a bit.