Moved session to own library

Session depends on other things that aren't inside core so it makes sense to move it out.