provision/docker: refactor test code

Putting flatten stub stuff on stubs_test and returning server on
startDockerTestServer.

Relates to #513.
provision/docker/stubs_test: faking output for export endpoint

and removed the fake for create, as it is not called.
provision/docker/flatten: initializing buffer and improved some logging

Relates to #513