Use sed instead of 'cut' to scrape the environ

 * Cut was not working quite so well w/ variables which contained
   newlines (E.g. IFS).  Instead of trying to parse the second field it
   is easier to just pass the data through sed and modify the line while
   only printing modified lines.
Make detection of functions a bit more portable
New interface shlib.hasfunc()
Improve leaked variable detection

 * We now attempt to aquire a list of 'internal' variables from the
   current `SHLIB_SHELL` which we use to filter out our assigned
   variables.
Cleanup unused variables
Make use of new shlib.hasfunc() interface