Eclipse writer cleanups

this PR includes the changes of #510. The second patch is the result of the review of OPM/opm-autodiff#98 and were proposed by @atgeirr...