Distributor

This pull request adds a distributor and 100% test coverage.

I'll sqash all the commits after review.