Flatten sessions into identities

@ryancarlson This is ready for review