Ported to 2.0.

It's all still mostly statically allocated. Uses the new time_ms instead of old time counting scheme. Uses snprintf instead of custom itoa functions. Leaks no memory.