Changed how Flow buttons are updated. Added some documentation

Test that FState and PState are read correctly. Changed how
set_flow_buttons works. Needs testing