Refactored unit of work & session.
Minor fixes.
Merge pull request #30 from adurieux/staging

Refactored unit of work & session.