Write linear fits

Adding a basic linear fits writer, and adding tests