Fix compiler issues

Instead of setting up a vm I used mingw, so still not tested on linux/mac. This version relies a bit more on compiler deduction instead of template specialization, but it still seems to run just fine.