Refactoring
Add secure session ID generator. Minor changes