Clean page classes of invalid CSS characters

 and make sure they don't start with a number. I prepend 'x' because '_' is reserved for vendor extensions. This fixes #1047.