Re-implement the charm-event legacy API endpoint.

Only support what strictly required by "juju publish".
This is based on Jay's work.
Let's add a comment here describing the endpoint, so that we know what the code is trying to deal with.