Async write

This includes my fix for issue #216
Tested and it worked

Disclaimer: Let me know if this pull request has issues (eg: bad branch)