eSessions.php cleaned up; + add session feature

Cleaned up some old function code and added a session add feature. It's
in a convenient place but does ABSOLUTELY NO ERROR CHECKING. It will
tell you if a query fails and it will tell you why. Foreign key
constraints appear to be working (at least partially -- haven't tested
all of them) but don't exactly fail gracefully.