provision/docker: moved collector code to collector.go.

related to #553.