generalize writing of derivative to file for most monomials and fully implement numerical derivatives for det,cloverdet,cloverdetratio and nrat