Clean up profiler implementation and separate it from command handling, add periodic saving of profiling information to disk.Signed-off-by: Ross Allan <[email protected]> (commit: 6f97fe8)