big refactor part 1

common base class for DSFunction and DSVarArgFunction
fixed some broken unit tests