Researchers have successfully demonstrated how an electronic device implanted directly into the brain can detect, stop and even prevent epileptic seizures.