Refactor CSV generation code to utils

Moving general CSV generation code from usage into utils so that it can be
used by other dashboards.

The file is named csvbase to avoid name collisions with csv module.

Change-Id: I3f4a573b53cb2d85fa36e84320707d74917498ad
Closes-bug: #1280475
Merge "Refactor CSV generation code to utils"