Added more stats tracking.

Also reworked migrations.