Dirty compact

Splits out `node-dirty` db compaction + migrations with tests.

Should chip away a bit at https://github.com/mapbox/tm2/issues/315