optimizing db calls for speed
major increase to write speed
corpus generation now uses multiple db calls in place of reading all at once