reorder incoming changes according to dependencies

Well, right now it's simple hack where we reorder changes according to
table names, because that's all we need to properly process them.

Signed-off-by: Jan Dvořák <mordae@anilinux.org>