refined API, nodeunit tests added