Added correct disposing and error logging when closing session factory; all exceptions are made serializable;