major reworking of code to separate out python wrappers.  still work in progress.