Fix Win32 threading breakage
Update primearray and add a simple iterator