Split drawtime/srcbytes stat handling + cookie encoding into its own lib with tests.
Merge pull request #781 from mapbox/stats

Stats refactor