Adds profiling to the words code and some logging bits