Fixed bugs and added new commands, notably "diff" and "migrate".