Fix failing test due to the change in plot handling
More plotting and session startup cleanup.
Major refactor of API - see history.rst for a summary