convert enum PlayMode into enum class

and make enum LayoutFlag a ": char" (making it an enum class rrequires
more work, as it is uses for flags)