Merge pull request #8547 from ricardoquesada/windows_phone8_project_fixes

Compiles on Windows Phone 8
works on win32

std::iterators weren't used correctly
Merge pull request #8549 from ricardoquesada/win32_fixes

works on win32