Resurrect test for Python instrument export.

It had been implemented incorrectly and it looked as if it was passing
when it wasn't.
There was also a bug with the getReferenceFrame import that this also
caught and fixed.
Refs #8000
Solve compiler warnings about const casting noted by gcc 4.7.2

Note technically related to this ticket but while we're improving tests...
Refs #8000
Change argument from by-value to to reference to const.

Avoids an unnecessary incref/decref of the internal PyObject pointer
when it is copied and destroyed.
Refs #8000
Merge remote branch 'origin/bugfix/8000_python_instrumenttest'