Tweak embedding API and rationalize trailing \n.

- On PencilCodeEmbed, rename past-tense event names "loaded" to
  present-tense "load", etc.
- Add more detailed unit tests that pull apart event sequencing, and
  adjust firing of the "update" event to match the test.
- Rationalize handling of trailing "\n" so that the editor always
  ensures a last line ending with "\n" even on initial load.
- Adjust embedding API so that write-only methods can be chained.