Rewrite of scripts to use new nxapi_base module

Rewrote scripts to use class and functions in nxapi_base module.