Make frame attributes appear in __repr__ in a deterministic order

See discussion in #2829 .  Right now the frame attributes don't always appear in the same order in `__repr__`.  That should be fixed.   

There's no trivial way to specify the order in the definition of the frame, because the attributes are declared at the class level. So probably the most sensible thing is to just sort them in alphabetical order inside `__repr__`.  

Once this is fixed, the doctests in #2829 should be re-enabled.