Add type definition of the state loop function
modify state framework to make simpler inheritance and instance passing
Refactor StateMenuEntry to use "inheritance"
Add show number to the inheritance model