Added web server and threading for remote control