Changed ObjectFactory code so that it works properly when building SuperTux as library