Took common code out of individual tests.

Also renamed all occurrences of session-IDs that were expected to be INTs (not objects) to be suffixed with "_int". Also put a getattr() call at the top of the adapter classes to have it allow both INT parameters -and- object parameters (for developer simplicity/non-ambiguity).