Created port.h, plus some code removal and refactoring.

What is wrong with including this (and http/http.h) files from other platform? Why these guards here?