Remove os-detect.sh and flatten dependent code.
Missed some file in last commit, remove os-detect.sh and flatten dependent code.