Initial version of Chat interface.
Major refactoring, involving changing the interface.