Add better exception handling
Get rid of os.system() in favor of subprocess

Also improve error handling in restartNPVR()