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.
and these are el-if blocks, so once one evaluates to true, the rest do not even get tested, so this logic can be simplified to (I think) just `if int in type_str` as if tuple was in it, we would never get here and if float and int where in it we would not get here