Dimacs parser and KTH parsers factored out