Fix potential error if changeset ID doesn't match up to user record.
Abstracted data selection creation to a factory object in preparation for introducing prepared statements.