Updates to pinvoke mechanism.  Work on capturing std in and out in log package.