Swapped out sparklines for D3.

Also cleaned up the output filehandling a little bit. It should be a drop-in replacement, but make sure it doesn't affect your server process.