Actually run the factory tests.

Forgot to hook up the actual tests.

Running them raised a few issues, fixed here.
 * closing the state connection
 * making sure the timestamps returned from the state.User are in UTC