Use shared_ptrs
Updates after review
Merge pull request #90 from Metaswitch/iss509

[Reviewer: Alex] Use shared_ptrs