Added MIT licence. Added dynamic stats builder.

Also finished percentile aggregator and started adding some tests for
the counters.