Classes get stripped out: why?
I haven't met this problem before. I did Google search and found this link Classes being stripped in CKeditor. Maybe your problems come from CKeditor and you just configure the allowedContent for CKeditor.