First draft of the migrations plugin, and some other stuff