Refactor sample responses

- Extract data washing to separate namespace
- Pull out functionality not directly required by defsample from the
  defsample namespace
- Update tests