Refactor update.
EORDER.
Fix incremental repo updates.

Insert should be accompanied with `OR REPLACE` for packages since we
want to upgrade packages information in repo.