Their behaviour can change when they're not feeling well. I would take him to the vet for a check up and a few tests to see if he has an infection or something like that. The poop/mucus doesn't sound good to me. Did you change anything lately, like his food?
The other thing just sounds like 'boy time' to me, male hedgehogs masturbate. It's normal.