Code tidy and performance fix
Slight code tidy.
Serialise comma separated list of integers for output to byte buffer before Fprintf-ing out, as code is still readable but performance is quite a bit better.

Change-Id: I1377246f5a9853769ddaa567ad8e242a91439ecc