Added hints and documented code

Fixed problem with session struct not being defined on reinit