Migrated a lot of code from gtktactoe.c to engine

There was some stuff in gtktactoe.c that I should have placed in engine.c, so I moved it. Additionally, I removed some functions from engine.h and made them static again in engine.c. I also removed some unneeded code from engine.c