Added Gui Factory support and changed some other things