- use file_put_contents() call instead of fopen() combo
- fix typo in strftime()
- fix stream wrapper to return amount of actual written bytes
  (file_put_contents() checks this and reports error when given !=
  written)
- add (slow) test coverage for filename calculation