Add bytesWritten property

Move function to property

Add callback