Changed the whole structure, no more globals (unless for orderqueue)

Remains to fix const arguments and minor fixes