Re-wrote session handler + extra tests