iOS: save changes on returning to the library

Also change the way the back button works, using an explicit action, rather
than relying on the navigation controller. Doing so allowed an alert dialog to
be displayed asking if document changes should be discarded or saved.
It also allowed the word-based button to be replaced by an icon-based one,
which saves space (important for iPod and iPhone).

We may want to also save on other occasions, but this at least provides some
way to do so.