I used node.js for my web panel. There is a module for node.js called "child", which lets you control other programs with it. You can also pipe the IO Stream and read console lines. Not so much inputting lines (torque does some wonky console stuff so idk). An annoying problem with that though is it leaves a blank console window, with no console lines popping up into it, but rather in node.js.
You could try that, however, I lost my web panel a while ago when reinstalling PC.