Fixing several bugs listed below:

 * Join buffer allocation: used malloc to alloc not aligned space.
 * Statistics: forgot to clear state before each read.
 * Memory issues: Alloc arrays using new char(5), this compiles but
   fails during run-time.
 * Delete arrays using delete[].
 * BigQ: unknown issue, switched to Qi's code.
 * File.cc: uninitialized curLength. This did not affect execution,
   but generate ugly outputs.

All these bugs are very hard to find and took several hours to hunt.
Some lessons I've learnt from this ordeal:

 * When using an object across iterations, check their status before
   each round.
 * Be very careful with allocs and deletes. Seg faults, corrupt memory,
   double free, etc are all caused by these mistakes.