Added export macros to template classes.
Made variables private instead of only protected in ClassFactory
Further changes to generate_export_header to (hopefully) make it working properly on Windows.