rearranged a bit, and implmented the session objects
Did some general clean up, and fixed bug in mock