MAINT: clean up and documentation of tecmag module