Updated profiling, put it in its own module, and added some profiling to a few methods.