Implantable technologies for closed-loop control of prosthesis