Moved macros for python bindings into an importable template.