Use make_shared instead of new to create pointers. Closes #189.