Trim Functions; more flexible cpu percentage

Created trim functions to remove leading and trailing spaces; allows
better cpu gathering on different distros