For consistency with php fread/fwrite, make size optional (default=1)
Add unit tests
See #5
missing files