Fixed factory errors resulting from refactoring in gamedesign
factory is working for simple user-defined buildings
Factory will no longer crash, but decode for Units still needs to be implemented (along with other things)