Made polygon iterable, and moved it's implementation into a seperate file

Making polygon iterable will allow us to do a lot more range-based for loops.
Having the implementation in a seperate file ensures the file is compiled whenever it is changed, and should shorten rebuild times.