First draft of DLF code
Fix compile issues with flagvector
More compile-bug fixes