altoslib: Add debugging to AltosPreferences.state() etc