Support V2 protocol

Summary:
V2 protocol with dimensions supported.  It's mostly
refactoring the old protocol to keep the common parts.

Test Plan: Use library to send to lab

Reviewers: tedo, kris

Subscribers: Diffs_emails

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