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

Bad name, can be defined by some rogue 3party include and fail compilation.
BRICKS_PORT_COUNT or something similar is much better.