Javascript Stopwatch class. Output can be controlled using a simple callback.