Some layout changes in page_singletone.c
cleaned mainloop

outsourced menu things to menu.c