Fix refs to removed function _detect_os()

Also convert some double-quotes to single-quotes and fix the purge
function. It was never running the command that it built, and it should
have been returning a boolean.