Refactor file-handling code into separate class
Add version of LLVM-style -debug-only flag