Refs #8475	Fixed Transfer function

The transfer function was failing because when groupget is called the parameter "wksp" has a workspace passed to it directly, this means that the original calls to mtd[wksp] would fail as AnalysisManager would expect a string.

Checks have been added to see what type wksp is before it's actually used, calling the AnalysisManager only if it's a string, otherwise useing the workspace as it is. It's also treated differently if it's a WorkspaceGroup vs any other kind of workspace.

Even if that call to the AnalysisMAnager had worked it was also discovered that WorkspaceGroup haddn't been imported from mantid.api so it would have complained there too.

Once all the syntax and parameter problems had been sorted, it was found that the way the run numbers were added to the table was wrong, so that has also been fixed.