Re-do the whole game architecture

It's supposed to be more flexible.