Cleaned up some compilation flags, made some variables extern for framework