Cppcheck fixes

I may have been overzealous in deleting unused stuff. Please review the scripting and opencs bits to make sure I'm not stepping on any toes.