fix bad json errors after migration

fixes #2211
fix missing files in database after upgrade

* move files update process after orders update since they need updated orders
* add some facility to display what's wrong in the file registry (like missing)

fixes #2327

Conflicts:
	inc/deployfile.class.php
make sure there is a multiparts in the json job

This is mandatory by agents because they fails if this key is not present (even if it's empty)
clean some code and comments

ok this is not properly related to update but the code deserved a good clean
fix files reconstruction errors after upgrade

FusionInventory agent were not able to reconstruct some files because
fileparts migration to manifests files were not ordered correctly.

fixes #2328