It is possible to join and complete both the Fighter's and Thieves guilds.
Join the Fighter Guild (FG) first and do the quests for Eydis till you are asked to get the Code Book. Go to the South Wall Corner Club and persuade Sottilde to give you the Code Book. If you join the Thieves Guild (TG) first then you can't persuade her and will have to either pickpocket the book (hard) or kill her (messy) to get it. After you get the book, talk to Sugar Lips to join the TG before you give the book to Eydis.
Another option is to not get the Code Book at all. You can still most of the other quests for Eydis later, but you need to go do some other stuff first.
1) go do FG quests in Vivec. Both Balmora FG and Vivec FG have a quest to collect some "Debt Money". After you complete (or even just accept) the Vivec "debt money" quest, Eydis will think you already completed her "debt money" quest and she will forget about the Code Book.
2) if you get into the TG there is a later quest for Jim Stacy to bribe Eydis with The Bitter Cup. Once you give her the cup she will stop helping Sjoring and the Camonna Tong (they want the Code Book).
To become Master of both guilds you just need to reach the rank of Champion in the FG. If you are that rank just keep doing the TG quests. Jim Stacey will eventually ask you to kill Sjoring. Before you actually go off to kill Sjoring, make sure you talk to Percius at Ald'ruhn so that he is willing to name you Master after Sjoring is gone.
If you did the Code Book quest the right way so that you were able to join both factions, you will still have a slight negative reputation in the TG. To get the few more rep points need to be named Master Thief, you just need to do the Bal Molagmer quests for Jim Stacey
...Also if you are a member of both guilds...
Sotilde will explain why she won't give you the book. Ignore the quest. You should rank Swordsman in the Guild and Percius will give you quests. Hrundi will always give quests. (Remember Caius warned you about something flaky in the Fighters Guild and he trusts Percius.)
But, you can get quests from Hrundi in Sadrith Mora and Percius Mercius in Ald Rhun to advance in the Fighters Guild. Percius is aware that the Cammona Tong has infiltrated the Thieves Guild though he won't immediately tell you. However if you feel that a quest is questionable (most of the ones from Vivec) ask Percius.
If you bribe Eydis she will forget the Codebook.