Stop using cfg.buildSessionFactory

Closes #13