Fix Issue #300
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 remote-tracking branch 'origin/garth/fix-issue-300'