You can back up your data first before unlocking your bootloader and such (
https://play.google.com/store/apps/details?id=com.koushikdut...). Works without even being rooted since it's a wrapper around the built in backup Android implemented since Android 4.0.
After that, you unlock via running a simple command which will let you flash your own compiled rom (alternative, you can unlock and then root and patch as you mentioned after unlocking the bootloader, but unlocking is the first step for either solution).
After backing up, run from your pc command line (you need the android sdk platform-tools first):
fastboot oem unlock
↑ that will wipe all your data and put it back in the state you got it initially, so make sure to back up first. More info on that can be found in the link below ↓
To go beyond that and root, you can find all the info you need here (http://rootzwiki.com/topic/12013-how-to-step-by-step-oem-unl...). I'm an admin on that site so if you have questions, someone will post and reply or I may if I'm not busy.