I don't know if you can avoid revolt, I am actually glad that it works
. Attacking grey, rebel cities will not make you at war with everybody nor excommunicated. Just reconquer the rebel cities, rebuild the empire. HRE is very easy, don't worry. Regarding the family tree, the trick is to keep the number of FM about 50-75% of the number of your settlements. Then your leaders will have children if they are married. Also, you need to be careful whom you adopt and whom you marry, so that your family tree is not too wide. If you have some usurpers - either wait until they start a legit royal dynasty or send them to battle where accidentally they will die.