Create a new factory.js for test utils.

- Move the existing methods over to it and refactor all the things.
- Drive by to sort and cleanup.
- Remove the circular import between utils/factory and update calls to always
pass the fake backend.

QA
------
It's a very mechanical change. Tests should pass. No tests were added or removed in the making of this pull request.