Created SessionFactory for initialising sessions based on config
Refactored internals to use SessionFactory