Cleaned up async code

Cleaned up async code and introduced new properties for last written
command and last received response.