DRY putting longs in a byte array
Rework CopyIn object handling

A small change can avoid creating a thread just to write the CSV to
the database.  Most of this is just threading the type change through.
Keep track of non-linear misses instead of all misses

..in the indexed temp file
Don't unnecessarily (re)serialize json

In the report tempfile, we serialize it as utf-8 encoded json.  When
we send the report, we generate utf-8 encoded json.  So don't parse
and reserialize when writing the report, just dump the bytes directly.