Persist NHibernate configuration

Rebased against current code