Cruft Removal

Mostly removed repetitive code in the insert_n() calls.
Database querys are standardized across the migration now.

Pulled a few inner loops out, but need more of this.