Fix Issue #71.

SWIG does not handle shared_ptr and directors properly, hence we need to somethimes store a reference to an object in the Python wrappers.
Merge branch 'garth/fix-issue-71' into next