PR commit for adding support for degree 1 curves

The actual code to write a curve to the stream is the same in both cases, factorize.