Not sure about the weird settings disappearing bit.
But regarding the categories, Gmail doesn't automatically expose these to IMAP. But there is something you can do even if a bit hacky.
Create 5 labels named after the 5 Categories. Then create 5 filters each of which look something like this.
Search criteria: "category:primary" -> Apply label "primary".
Repeat the above step for all the categories. Et Voila. Your categories will appear in IMAP as folders of the same name.