base: File API

Missing:

* Docs as docbook, fix typos etc
I moved the abort further down below.  It seems gratuitous to abort a previous write because someone tries to write a unstringifyable thing.