Reorganize, working on bug (see TODO)
Fixed start_pos/end_pos bug

In detect.cxx, lastSeen = chunk->getEndPos() called after chunk
was merged. The result was referencing deallocated memory.