Refactor to allow more than just sending datapoints.

Test Plan: unit tests

Reviewers: jack

Reviewed By: jack

Subscribers: Diffs_emails

Differential Revision: http://phabricator.signalfuse.com/D3855