class reorganization and refinement of redate($datestring) function