Add log() function for friendlier logging.

Add helper functions for timing.