Changed include order, add osdetect.h documentation
I like the include order of

I guess this order could be horribly ugly and disgusting, but I don't know what is better.