implement states for reading/writing memory contents from the
serial monitor.
fix serial monitor bugs.