Sessions

incorporates parts of #14 and #20