A handheld tool, similar to a pen, can detect cancer in a matter of seconds and give surgeons a better chance of removing "every last trace" of the disease, a team of scientists said.