Cleaned up session class

Also added save function for SQLServerGenerator.