Added configuration stuff and cleaned up some very dangerous compileflags