Partially implemented get_state and set_state
PEP8 fixes
Store values as json