Added `argsToArray` function along with tests for it.