replace variable length arrays with std::vector

I have prepared the most direct version of std::vector-instead-variable-c99-array, intentinally not changing the signatures. I hope you'll introduce vector parameters etc. in more  consistent way than I can.

The final steps to support Windows is the described array change and d2d77a1a2c75ffb18e0718036230e5865d193633 inclusion (done in master but not here).