dont reimplement bytes method
test generate_key more thoroughly
add and test close helper
share implementation for sync stuff