base: File API

Missing:

* Binary files
* File removals
* Unit tests
* Docs as docbook, fix typos etc
Write channel should be cleared, since you can return below before write_channel is set again.