codeintel: Refactor data migrator
Created by: efritz
This refactors the generic code intelligence oob migrator so that:
- The migrations themselves can be unaware of dump ids
- Can actually tell what stuff is doing (major functionality broken into functions)
- We select records whose bounds need to be updated regardless if there are migrable records (this fixes a 97% complete-now-stuck bug in cloud)
- Fixes contention issue where multiple migrators will select rows from the same dump id (now we lock schema_version records, and not the records in the data table)
Please review migrator.go's new code only (not the diff). Other file's diffs are reasonable :)