fix use of export macros to work with mingw(64)
fix use of export macros to work with mingw(64). Template issues with msvc will require a different solution (if they exist)