Fixed wrap_lib

Addressed all comments from the previous PR from Tom. Closed that PR and opened this one. Contains the completely updated and corrected wrap_lib.py module.
somethings (like a write-to-file function or log-to-database) should not have output pots I think this test should be dropped.