Sessions

A bunch of networking code to handles sessions and such

@nockertsb please review