First version of sgnvarf and some tests.