getCSVFromVector: optimize and add tests

Optimization: avoid copy; simpifiled unnessary branches; reduced
temperary string being created when doing string concatenation.

Added unit test for this function.

Tested: unit test

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I8c334dc4f087e262bb3e8613e86cfc2a93d525a0
3 files changed