Rewrite main.js to use a different approach to components

The component interface has the same garantuees albeit slightly
  different interface design.

A component returns state & events. Previously it returned an
  events object with a state property.

Now it returns { events, state }. It can be trivially refactored
  to once again return an events object with a state property.

More importantly we store the state that was already public in
  our `mercury.hash()` this means that any state changes to that
  component bubble up the global state atom and cause a global
  redraw.

Note that our usage of `partial()` reduces the cost of a global
  redraw. If we don't want a global redraw we can do a future
  optimization to remove said global redraws and instead use
  local subtree rendering approach. This is totally possible
  and has orthogonal trade offs that should be considered
  later.

We refactored the event listening code to use the new `.events`
  property but again this could be collapsed to be the main
  result of `FrameList()` with `state` being a property of it.

The other important change is that inside `render()`,
  the `state.editor` and `state.frameList` data structures are
  plain JSON serializable data structures. They do not contain
  `partial()` method. Instead we use the statically defined
  `Render` functions on the components and invoke them with
  their data structures.

This means the `partial()` method no longer is a method and
  it get's state from the first argument instead of `this`.

This entire refactor addresses all concerns except it uses
  the `Input, State, Render` pattern. A component returns a
  tuple of `{ Input, State }` and exposes a `Render`.

The `state` atom at the top has the normal immutability
  semantics you expect and the `render` is a function that
  uses nested function calls. This means that `render()`
  is a "simple" function that takes a JSON data structure
  and returns a plain vtree structure.

Also note that `Render` can return a simple `vtree` rather
  then return a `Widget` from `partial()`.

Also note that `FrameList` now has an interface where
  you can create one, and wire up `state` and `Render` to
  `mercury.app()` and it just works (tm). With the previous
  approach you would need a wrapper state atom and a wrapper
  render function to box & unbox the widget with a `partial()`
  call.