Added correct disposing and error logging when closing session factory; all exceptions are made serializable;
#840: master page properties saving updated.
Merge branch 'dev_1.4.0_fix840'