Initial framework for dynamic sub menus
Added state machine, didn't solve the problem it was meant to but I'm keeping it.