All you have to do is make a backup in recovery, do a full factory wipe them flash CM & gapps. However, keep in mind that if you want to go back to a TW based rom you will find that a lot of apps won't work properly. Even after restoring a nandroid I was having problems with apps not being able to access data (for example my weather widget couldn't d/l skins and my app market app couldn't d/l anything.)
To get things working normally on my TW backup I had to use Odin to go to stock MJ4. Then I had to do a factory reset within stock MJ4. Then I had to Odin TWRP recovery then finally restore my backup.
In short I really hope you like AOSP because if you don't it's a major PITA to return to TW
Sent from my SM-N900P using XDA Premium 4 mobile app