You need to be jailbroken for this to work.
Transfer all your apps to iTunes so you can get them back.
Backup the following file using iFile in the following directory: private/var/mobile/Library/SpringBoard
IconState.plist
Backup this file to dropbox using iFile.
Restore iPhone as new. Sync apps back using iTunes. Re-jailbreak phone. Install iFile.
To restore springboard organization, rename the backed up file IconState.plist to DesiredIconState.plist and then copy to private/var/mobile/Library/SpringBoard. Overwrite the existing file if necessary. Respring and springboard layout should be restored. Now all you have to do is go through the tedious process of logging into apps and setting the phone back up the way you like it.
Transfer all your apps to iTunes so you can get them back.
Backup the following file using iFile in the following directory: private/var/mobile/Library/SpringBoard
IconState.plist
Backup this file to dropbox using iFile.
Restore iPhone as new. Sync apps back using iTunes. Re-jailbreak phone. Install iFile.
To restore springboard organization, rename the backed up file IconState.plist to DesiredIconState.plist and then copy to private/var/mobile/Library/SpringBoard. Overwrite the existing file if necessary. Respring and springboard layout should be restored. Now all you have to do is go through the tedious process of logging into apps and setting the phone back up the way you like it.