Fix build problems on Windows by explicitly exporting/importing "function"

The test-app does not link to test-library out of the box on windows. This is because "function" is not exported to be externally visible when building test-library on Windows.

This pull request fixes this problem by tagging "function" with dllexport/dllimport attributes when building on Windows. It's possible to also introduce similar attributes for GCC/LLVM if there is interest in that (https://gcc.gnu.org/wiki/Visibility).