First hack at new API.  Segfaults when closing, and doesnt log data until the backends are rewritten