Misc code format
Misc comment update/format
Add check what state is current with isCurrentPanel(key)
Add centralized debug stats to one location, to make it easier in the
future