moved genericconfig to gconfig.c and reorganised header files