Session Init performance problem fix

Added index to sessions table, cleanup of old session data.
Experimental internal template engine.