Fix lots of DIMACS parser problems

The parser was not correctly detecting an error when the preamble does
not have a newline. Changed so it just uses a regular expression to grab
the entire preamble.

Also, lots of other little cleanup.
Add several DIMACS test cases